<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="../common/common.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的队员</title>
<script type="text/javascript">
	$(function(){
	});
	
	function getMyTeammate(){
		$.ajax({
			type:"POST",
			url:"<%=basePath%>team/getMyTeammate",
			success : function(result) {
				if(result.success){
					alert("成功!");
					var userList = success.userList;
				}else{
					
					alert(result.errorMsg);
				}
			},
			error : function(result) {
				alert("error");
			}		
		});
		
	}
	
	//委任队长
	function appointCaptain(id){
		
		
		$.ajax({
			type:"POST",
			url:"<%=basePath%>team/appointCaptain",
			data:{"newCaptainId":id},
			success : function(result) {
				if(result.success){
					alert("成功!");
				}else{
					
					alert(result.errorMsg);
				}
			},
			error : function(result) {
				alert("error");
			}		
		});
		
	}
	
</script>
</head>
<body>
	
		<table id="table" cellspacing="0" cellpadding="3" border="1">
		
		<thead>
				<tr>
					<th></th>
					<th>用户名</th>
					<th>邮件</th>
					<th>手机号</th>
					<th>姓名</th>
					<th>是否是队长</th>
					<th>操作</th>
				</tr>
		</thead>
			<tbody>
				<c:choose>
					<c:when test="${not empty userList}">
						<c:forEach items="${userList}" var="var" varStatus="vs">
							<tr>
								<td class='center' style="width: 30px;">
								<input type='checkbox' name='ids' value="${var.id}" /><span class="lbl"></span>
								</td>
								<%-- <td class='center' style="width: 30px;">${vs.count}</td> --%>
										<td>${var.username}</td>
										<td>${var.email}</td>
										<td>${var.mobile}</td>
										<td>${var.name}</td>
										<td>${var.isCaptain }</td> 
										<td><button onclick="appointCaptain(${var.id})">委任队长</button>  </td>
							</tr>
						
						</c:forEach>
					</c:when>
					<c:otherwise>
						<tr class="main_info">
							<td colspan="100" class="center" >没有相关数据</td>
						</tr>
					</c:otherwise>
				</c:choose>
			</tbody>
		</table>
	
	

</body>
</html>